package com.wl.eb.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wl.eb.mapper.EbUserMapper;
import com.wl.eb.module.EbUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LoginService {
    @Resource
    private EbUserMapper ebUserMapper;

    public EbUser login(EbUser ebUser){
        List<EbUser> ebUserslist = ebUserMapper.selectList(new QueryWrapper<EbUser>()
                .eq("Eu_User_Name", ebUser.getEuUserName())
                .eq("Eu_Password", ebUser.getEuPassword()));
        if(ebUserslist.size()==0){
            throw new RuntimeException("登录失败");
        }
        return ebUserslist.get(0);
    }
}

